﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Data;
using GalaSoft.MvvmLight;

namespace TeacherLeftHand.Util
{
    public class TranslationContext : ViewModelBase
    {
        public ICollectionView Languages { get; private set; }


        public TranslationContext()
        {
            try
            {
                Languages = CollectionViewSource.GetDefaultView(TranslationManager.Instance.Languages);
                Languages.CurrentChanged +=
                    (s, e) => TranslationManager.Instance.CurrentLanguage = (CultureInfo) Languages.CurrentItem;

            }catch(Exception ex)
            {
                MessageBox.Show(ex.ToString()); 
            }
        }
    }
}
